-
Spring Boot MyBatis 将 PostgreSQL jsonb 转为 Jackson 3 JsonNode
类型处理器 import org.apache.ibatis.type.BaseTypeHandler; import org.apache.ibatis.type.JdbcType; import
2026-01-28, Views: 18 , Topics: Spring Boot MyBatis JSON
-
Spring Boot MyBatis-Plus 设置不读取指定字段
select = false 在指定字段上添加@TableField(select = false)即可。 示例代码 @Setter @Getter @ToString @TableName(val
2026-01-27, Views: 25 , Topics: Spring Boot MyBatis-Plus
-
Spring Boot 以 Jar 包方式运行的启动流程解析
流程 Spring Boot Loader通过Main-Class启动,然后根据Start-Class再启动应用。 如果直接把Main-Class指向你的应用类,那么Jar就无法使用Spring B
2026-01-26, Views: 42 , Topics: Spring Boot JVM
-
Spring Boot Jar 包瘦身优化:省略 loader.path 启动参数
概述 在之前的文章中将Uber Jar打包为Separated Jar,启动程序时需要指定-Dloader.path。 MANIFEST.MF 在MANIFEST.MF设置Loader-Path,则
2026-01-23, Views: 53 , Topics: Spring Boot Maven JVM
-
Spring Boot Jar 包瘦身
概念 Uber Jar Spring Boot单一可执行的文件。直接以java -jar app.jar启动。 Thin Jar Spring Boot提供了一种打包时的插件,依赖将在打包时通过网络
2026-01-22, Views: 69 , Topics: Spring Boot Maven JVM
-
Spring Boot MyBatis-plus 分页插件 PaginationInnerInterceptor 类无法找到
原因 MyBatis-plus 3.5.9版本后分页插件单独拆分成了mybatis-plus-jsqlparser。 引入依赖 <dependency> <groupId>com.baomi
2026-01-21, Views: 72 , Topics: MyBatis-plus Spring Boot
-
Spring Boot 定时任务平台线程与虚拟线程不同配置
版本 Spring Boot 3.2.3 Java 代码 @Slf4j @Component @EnableScheduling @EnableAsync public class Schedule
2026-01-20, Views: 76 , Topics: Spring Boot juc jcmd
-
Spring Boot 将 Bean 对象注入到 Map 和 List 中
解释 Spring支持将@Service、@Bean等Spring托管的类,注入到Map和List中。 案例 如登陆服务,有一个抽象类LoginService,分别有微信登录和QQ登陆都实现了这个抽
2026-01-19, Views: 84 , Topics: Spring Boot Spring
-
Spring Boot Thymeleaf 格式化 OffsetDateTime 时区问题
现象 Spring Boot从PostgreSQL中定时读取数据,createdAt字段是timestamptz类型。 使用Thymeleaf格式化时,如果是Asia/Shanghai(+8)时区,
2026-01-18, Views: 89 , Topics: Thymeleaf Spring Boot
-
Spring Boot 单元测试覆盖 TransactionTemplate 编程式事务
业务代码 @Service public class MyService { @Resource TransactionTemplate transactionTemplate;
2026-01-17, Views: 90 , Topics: 单元测试 Spring Boot 事务
-
Spring Boot Debug 时从拦截器中获取所有 Controller 路径
需求 线上环境报路径找不到错误,Debug时发现拦截器直接返回了。 原因 发现是拦截器中直接是/error错误页面的Controller进入了拦截器。 拦截器 @Slf4j public class
2026-01-16, Views: 100 , Topics: Spring Boot Debug
-
Spring Boot ClickHouse JDBC 报 LZ4 is not supported
错误详情 LZ4 is not supported. Please disable compression(compress=0), modify the algorithm(e.g. compr
2026-01-15, Views: 129 , Topics: Spring Boot ClickHouse JDBC
-
Java25 Spring Boot Lombok 打包失败解决方法
现象 项目升级使用了Java25和Spring Boot 3.5.6,打包时报错,找不到log变量。 分析 项目使用了Lombok的@Slf4j注解,所以找不到log变量肯定与Lombok注解有关。
2026-01-13, Views: 122 , Topics: Java Spring Boot Lombok
-
Spring Boot Jackson 创建 JsonNode 对象
代码 使用ObjectMapper的createObjectNode方法创建对象类型JsonNode,使用createArrayNode方法创建数组类型JsonNode。 ObjectMapper
2025-09-30, Views: 515 , Topics: Jackson Spring Boot
-
Spring Boot Jackson No serializer found for class
Spring Boot Jackson No serializer found for class 错误信息 No serializer found for class xxx and no pr
2025-09-29, Views: 493 , Topics: Jackson Spring Boot
-
Spring Boot MyBatis-Plus setSql() 方法用法
自定义 SQL 片段 setSql(String setSql, Object... params) boolean success = pointsService.lambdaUpdate()
2025-09-28, Views: 502 , Topics: MyBatis-Plus Spring Boot
-
Spring Boot 单元测试覆盖 MyBatis-Plus Lambda 链式调用
LambdaQuery 业务代码 @Service public class MyService { @Resource MyLambdaService myLambdaServi
2025-02-28, Views: 1684 , Topics: MyBatis-Plus 单元测试 Spring Boot
-
Spring Boot Maven 打包插件 maven-compiler-plugin 与 maven-jar-plugin 的区别
maven-compiler-plugin 用于编译 Java 源代码。配置和控制编译过程,例如指定Java编译器的版本、设置编译选项、排除或包括特定文件等。 <build> <plugin
2025-01-02, Views: 2188 , Topics: Maven Spring Boot
-
Spring Boot MyBatis 返回 Map 类型
@MapKey MyBatis中提供了注解@MapKey,将结果集映射成HashMap。 举例 原先返回List<User>,使用@MapKey后返回Map<String, User>。 注意:@M
2024-12-30, Views: 1803 , Topics: MyBatis MyBatis-Plus Spring Boot
-
Spring Boot @PostConstruct 报错后程序没有退出
期望场景 Kubernetes中,Spring Boot容器在@PostConstruct中进行远程调用拉取配置,如果拉取失败则抛出异常,程序结束运行,Pod重新启动。 程序不退出排查 使用jcmd
2024-12-26, Views: 1331 , Topics: Spring Boot jcmd JVM